﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 嵌套循环
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] 整形数组=new int[]{2,0,9,8,3,7,6,4};
            从小到大排序(整形数组);
            foreach (var 随便啦 in 整形数组)
            {
                Console.WriteLine(随便啦);
            }
            Console.ReadKey();

        }

        static void 从小到大排序(int[] 数组)
        {
            for (int i = 0; i < 数组.Length-1; i++)
            {
                for (int j = 0; j < 数组.Length-1; j++)
                {
                    if (数组[j] > 数组[j + 1])
                    {
                        int 临时变量 = 数组[j];
                        数组[j] = 数组[j + 1];
                        数组[j + 1] = 临时变量;
                    }
                }
            }
        }
    }
}
